package jdk8的特性.Stream.跳过元素;

import java.util.List;
import java.util.stream.Collectors;

import static jdk8的特性.Stream.跳过元素.MockDB.mockUserList;

/**
 * @author idea
 * @data 2018/9/8
 */
public class Test {

    public static void main(String[] args) {
        List<User> userList = mockUserList(15);
        List<String> usernameList=userList.parallelStream()
                .filter(User::isGril)
                .map(User::getUsername)
                .skip(3)
                .collect(Collectors.toList());
        //使用skip跳过女性用户的头三个人
        usernameList.forEach((username)->{
            System.out.println(username);
        });
    }
}
